import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/home',
    name: 'home',
    redirect:'/main',
    component: () => import('@/views/home/Home.vue'),
    children: [
      {
        path: "/main",
        component: () => import("../views/home/Main.vue")
      },
      {
        path: "/userInfo",
        component:()=>import("@/views/home/UserInfo.vue")
      },
        //==========================系统管理====================================
        {
            path: '/system/dept',
            component: () => import('../views/system/dept.vue'),
        },
        {
            path: '/system/user',
            component: () => import('../views/system/user.vue'),
        },
        {
            path: '/system/role',
            component: () => import('../views/system/role.vue'),
        },
        {
            path: '/system/menu',
            component: () => import('../views/system/menu.vue'),
        },
        {
            path: '/system/dict',
            component: () => import('../views/system/Dict.vue'),
        },
        {
            path: '/system/notice',
            component: () => import('../views/system/notice.vue'),
        },
        {
            path: '/system/ins_fee',
            component: () => import('../views/system/insFee.vue'),
        },
        {
            path: '/system/reg_fee',
            component: () => import('../views/system/regFee.vue'),
        },
        {
            path: '/system/userInfo',
            component: () => import('../views/home/UserInfo.vue'),
        },
        {
            path: '/system/news',
            component: () => import('../views/system/News.vue'),
        },
        //路由传值
        {
            path: '/system/dictData/:dictId',
            component: () => import('../views/system/dictData.vue'),
        },

        // 登录日志
      {
        path: '/system/log_login',
        component: () => import('../views/system/LoginInfo.vue'),
      },
      {
        path: "/system/log_opt",
        component: () => import('../views/system/OptLog.vue'),
      },
      {
        path: '/system/whiteName',
        component: () => import('../views/system/whiteName.vue')
      },

      //===============================统计===============================
      //收支统计
      {
        path: "/statistics/revenue",
        component: () => import('../views/statistics/revenue.vue')
      },
      // =====系统首页的收支===========
      {
        path: "/charge/docharge",
        component: () => import('@/views/charge/Docharge.vue')
      },
      //2.销售统计

      {
        path: "/charge/backfee",
        component: () => import('@/views/charge/backfee.vue')
      },
      {
        path: "/charge/chargelist",
        component: () => import('@/views/charge/chargelist.vue')
      },
      {
        path: "/charge/backfeelist",
        component: () => import('@/views/charge/backfeelist.vue')
      },
      {
        path: "/charge/dispensing",
        component: () => import('@/views/charge/dispensing.vue')
      },

      // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  收费管理 end  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      {
        path: "/statistics/sales",
        component: () => import('../views/statistics/sales.vue')
      },
      //检查项目统计
      {
        path: "/statistics/check",
        component: () => import('../views/statistics/check.vue')
      },
      //工作量统计
      {
        path: "/statistics/workload",
        component: () => import('../views/statistics/workload.vue')
      },
      //医生评论
      {
        path: "/statistics/comment",
        component: () => import('../views/statistics/comment.vue')
      },
      //===============================药品进销存===============================
        //厂家信息维护
      {
        path:"/stock/producter",
        component: ()=>import("@/views/stock/Producter.vue")
      },
      //   供应商
      {
        path:"/stock/provider",
        component:()=>import("@/views/stock/Provider.vue")
      },
      //   商家
      {
        path: "/stock/medicinal",
        component:()=>import("@/views/stock/Medicinal.vue")
      },
        //库存查询
      {
        path: "/stock/Inventory",
        component:()=>import("@/views/stock/Inventory.vue")
      },
        //入库审核
      {
        path: "/stock/examine",
        component:()=>import("@/views/stock/purchase/Examine.vue")
      },
        //采购入库
      {
        path: "/stock/purchase",
        component:()=>import("@/views/stock/purchase/Purchase.vue")
      },
        //新增采购
        {
            path: "/stock/purchase/newPurchase",
            component:()=>import("@/views/stock/purchase/newPurchase.vue")
        },
        //采购入库/订单查询
      {
        path: "/stock/purchase/editPurchase/:purchaseId",
        component:()=>import("@/views/stock/purchase/editPurchase.vue")
      },
      //===============================检查管理===============================
      {
        path: "/check/docheck",
        component:()=>import("@/views/check/Docheck.vue")
      },
    //     检查结果
      {
        path:"/check/checkresult",
        component:()=>import("@/views/check/Checkresult.vue")
      },
      //   查询
      {
        path: "/check/checklist",
        component:()=>import("@/views/check/Checklist.vue")
      },
        {
            path: "/stock/purchase/editPurchase/:purchaseId",
            component:()=>import("@/views/stock/purchase/editPurchase.vue")
        },
      //===============================看病就诊===============================
      //1.门诊挂号
        {
          path: "/doctor/registered",
          component: () => import('../views/doctor/Registered.vue')
        },
      //2.挂号列表
        {
          path: "/doctor/registeredlist",
          component: () => import('../views/doctor/Registration.vue')
        },
      //3.新开就诊
        {
          path: "/doctor/newcare",
          component: () => import('../views/doctor/NewCare.vue')
        },
      //4.我的排班
        {
          path: "/doctor/myscheduling",
          component: () => import('../views/doctor/Myscheduling.vue')
        },
      //5.医生排班
      {
        path: "/doctor/scheduling",
        component: () => import('../views/doctor/scheduling.vue')
      },
      //6.患者库
      {
        path: "/doctor/patient",
        component: () => import('../views/doctor/Patient.vue')
      }
    ]
  },
  {
    path: "/",
    component: () => import("../views/home/Login.vue")
  },
  {
    path: "/login",
    component: () => import("../views/home/Login.vue")
  },
  {
    path: "/main",
    component: () => import("../views/home/Main.vue")
  },

  {
    path: '/about',
    name: 'about',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/AboutView.vue')
  }
]

const router = new VueRouter({
  routes
})

export default router
